<!DOCTYPE html>
<html lang="en">

	<include file="Public:header" />
	<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Common/Ueditor/ueditor.config.js"></script>
	<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Common/Ueditor/ueditor.all.min.js"></script>
	<script language="javascript" type="text/javascript" src="__ROOT__/Statics/My97/WdatePicker.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
	<include file="Public:page_css" />

<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
	<include file="Public:nav" />
	<div class="row wrapper border-bottom white-bg page-heading">
		<div class="col-lg-12">
			<h2>添加广告</h2>
			<ol class="breadcrumb">
				<li>
					<a href="index.html"> <i class="fa fa-home"></i>
						主页
					</a>
				</li>
				<li>
					<a>广告管理</a>
				</li>
				<li> <strong>添加广告</strong>
				</li>
			</ol>
		</div>
	</div>
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox float-e-margins">
				<div class="ibox-title">
					<h5>添加广告</h5>
					<div class="ibox-tools">
						<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
						</a>
					</div>
				</div>
				<div class="ibox-content">
					<form class="form-horizontal" method="post" action="{:U('Advert/add')}" name="basic_validate" id="signupForm">
						<div class="form-group">
							<label class="col-sm-2 control-label">标题</label>
							<div class="col-sm-6">
								<input type="text" name="title" id="title" placeholder="输入广告标题" class="form-control"></div>
						</div>
						<div class="hr-line-dashed"></div>
						<div class="form-group">
							<label class="col-sm-2 control-label">子标题</label>
							<div class="col-sm-6">
								<input type="text" name="subtitle" id="subtitle" placeholder="输入广告子标题" class="form-control"></div>
						</div>
						<div class="hr-line-dashed"></div>
						<div class="form-group">
							<label class="col-sm-2 control-label">所属分类</label>
							<div class="col-sm-6">
								<select name="adverttype"  class="form-control m-b chosen-select">
									<volist name="list" id="vo">
										<option  value="{$vo.id}">{$vo.name}</option>
									</volist>
								</select>
							</div>
						</div>

						<div class="hr-line-dashed"></div>
						<div class="form-group">
							<label class="col-sm-2 control-label">广告图片</label>
							<div class="col-sm-6">
								<div style="width: 200px; height: 110px; float: left;">
									<input type="hidden" name="imageurl" value="" id="data_photo" />
									<input id="photo_file" name="photo_file" type="file" multiple="true" value="" />
								</div>
								<div style="width: 200px; height: 110px; float: left;">
									<img id="upload_img" src="__ROOT__/Uploads/{$detail.imageurl}" onerror="this.src='__PUBLIC__/Admin/img/no_img.jpg'" style="width: 150px;height: 100px" />
								</div>
							</div>
						</div>
						<div class="hr-line-dashed"></div>
						<div class="form-group">
							<label class="col-sm-2 control-label">广告内容：</label>
							<div class="col-sm-10">
								<script type="text/plain" id="editor" name="info" style="width:78%;height:300px;"></script>
							</div>
						</div>
						<div class="hr-line-dashed"></div>
						<div class="form-group">
							<label class="col-sm-2 control-label">联系人</label>
							<div class="col-sm-6">
								<input type="text" name="linker" id="linker" placeholder="输入联系人" class="form-control"></div>
						</div>
						<div class="hr-line-dashed"></div>
						<div class="form-group">
							<label class="col-sm-2 control-label">手机号码</label>
							<div class="col-sm-6">
								<input type="text" name="phone" id="phone" placeholder="输入手机号码" class="form-control"></div>
						</div>
						<div class="hr-line-dashed"></div>
						<div class="form-group">
							<label class="col-sm-2 control-label">状态</label>
							<div class="col-sm-6">
								<div class="radio i-checks">
									<input type="radio" name='state' value="1" checked="checked" />
									开启
									<input type="radio" name='state' value="0" />
									关闭
								</div>
							</div>
						</div>
						<div class="hr-line-dashed"></div>
						<div class="form-group">
							<label class="col-sm-2 control-label">地址</label>
							<div class="col-sm-6">
								<input type="text" name="address" id="address" placeholder="输入地址" class="form-control"></div>
						</div>
						<div class="hr-line-dashed"></div>
						<div class="form-group">
							<div class="col-sm-4 col-sm-offset-2">
								<button class="btn btn-primary" type="submit">保存内容</button>
								<a class="btn btn-danger" href="{:U('Advert/index')}">取消</a>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
	<include file="Public:footer" />

	<js file='__PUBLIC__/Common/js/uploadify/jquery.uploadify.min.js' />
	<link rel="stylesheet" href="__PUBLIC__/Common/js/uploadify/uploadify.css">
	<script src="__PUBLIC__/Admin/js/plugins/validate/jquery.validate.min.js"></script>
	<script src="__PUBLIC__/Admin/js/plugins/validate/messages_zh.min.js"></script>
	<script src="__PUBLIC__/Admin/js/form-validate-adduser.js"></script>

	<script type="text/javascript">
		$("#photo_file").uploadify({
			'swf': '__PUBLIC__/Common/js/uploadify/uploadify.swf?t={$nowtime}',
			'uploader': '{:U("Upload/upload")}',
			'cancelImg': '__PUBLIC__/Common/js/uploadify/uploadify-cancel.png',
			'buttonText': '上传图片',
			'height': 35,
			'fileTypeExts': '*.gif;*.jpg;*.png',
			'queueSizeLimit': 1,
			'onUploadSuccess': function(file, data, response) {
				$("#data_photo").val(data);
				$("#upload_img").attr('src', '__ROOT__/Uploads' + data).show();
			}
		});
			
		var ue = UE.getEditor('editor');
		var editor_a = new baidu.editor.ui.Editor(editorOption);
		editor_a.render('editor');
		
	</script>
	<script>
       
        var config = {
            '.chosen-select': {},                    
        }
        for (var selector in config) {
            $(selector).chosen(config[selector]);
        }

    </script>
</body>

</html>